ShowPasteAsDialog
Mac OSThe
ShowPasteAsDialog
method displays the Paste As dialog box and sets the appropriate dialog items according to the input parameters.
ODBoolean ShowPasteAsDialog ( in ODBoolean canPasteLink, in ODPasteAsMergeSetting mergeSetting, in ODFacet facet, in ODTypeToken viewType, in ODStorageUnit contentSU, out ODPasteAsResult theResult);
canPasteLink
- kODTrue if the destination part allows a link to be created, otherwise
kODFalse
.mergeSetting
- A value indicating whether embedding and merging are supported; determines the initial setting for the At the Destination radio buttons.
facet
- A reference to the facet in which the drop is to occur.
viewType
- A tokenized string representing the initial setting for the view type of the embedded part (if embedding is chosen).
contentSU
- A reference to the content storage unit for the drag item being pasted.
theResult
- A structure reflecting the user's selections in the Paste As dialog box.
- return value
kODTrue
if the user clicked OK to leave the Paste As dialog box, otherwisekODFalse
.DISCUSSION
If your part is the destination of a drop and the user requests a Paste As operation, you can call this method to display the Paste As dialog box for a particular drag item. On the Mac OS platform, whenever your part is the destination of a drop, you should call theGetDragAttributes
method of the drag-and-drop object; if thekODDropIsPasteAs
flag is set in the drag attributes, you must call this method.If the
canPasteLink
parameter is true, the content storage unit contains a link specification, and the draft permissions allow writing, then the Paste with Link checkbox is enabled. If that checkbox is enabled, its initial setting is checked.The mergeSetting parameter specifies which At the Destination radio button (Merge with Contents or Embed As) is initially selected in the Paste As dialog box and whether the other button is available. It must be one of the following:
The
- Embed As is initially selected; Merge with Contents is available (
kODPasteAsEmbed
).- Embed As is selected; Merge with Contents is disabled (
kODPasteAsEmbedOnly
).- Merge with Contents is initially selected; Embed As is available (
kODPasteAsMerge
).- Merge with Contents is selected; Embed As is disabled (
kODPasteAsMergeOnly
).
viewType
parameter must be the tokenized form of one of the view-type constants (kODViewAsFrame
,kODViewAsLargeIcon
,kODViewAsSmallIcon
, orkODViewAsThumbnail
). You can call the session object'sTokenize
method to obtain a token corresponding to one of these constants.If the user clicks OK, this method returns true and sets the fields of the output parameter,
theResult
, to indicate the selections the user made in the Paste As dialog box; in this case, you must deallocate the non-nullselectedKind
,translateKind
, andeditor
fields of thetheResult
structure when you are finished using them.If the user cancels the dialog box, this method returns false and you do not need to take any further action.
EXCEPTIONS
kODErrIllegalNullStorageUnitInput
- The
ContentSU
parameter is null.kODErrNullFacetInput
- The
facet
parameter is null.kODErrNullPasteAsResultInput
- The
theResult
parameter is null.SEE ALSO
TheODPasteAsResult
type (page 918).
TheODTypeToken
type (page 877).
TheODDragAndDrop::GetDragAttributes
method (page 191).
TheODSession::Tokenize
method (page 622).
"Handling the Paste As Dialog Box" on page 337 in OpenDoc Programmer's Guide.
"Drag Attributes and the Drop Method" on page 364 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help